/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package siabukukaskoperasi;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author ASUS 1215P
 */
public class LoginTabelModel extends AbstractTableModel{
    private List<Login> L = new ArrayList<Login>();

    public LoginTabelModel(List<Login> L){
        this.L=L;
    }

    public int getRowCount() {
        return L.size();
    }

    public int getColumnCount() {
        return 3;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
       Login kat= L.get(rowIndex);
       switch (columnIndex){
           case 0:
               return kat.getUserName();
           case 1:
               return kat.getPassword();
           case 2:
               return kat.getStatus();
           default:
               return "";
    }
    
}
    @Override
    public String getColumnName(int column){
        switch (column){
            case 0:
                return "USERNAME";
           case 1:
               return "PASSWORD";
            case 2:
                return "STATUS";
             default:
               return "";
        }
    }
}
